/*
 * Copyright 2010 Cedric Priscal
 *
 * This file is part of stupid-avr-robot.
 *
 * stupid-avr-robot is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * stupid-avr-robot is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with stupid-avr-robot.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "PropertyS8.h"

PropertyS8::PropertyS8(PropertyListener* listener) : Property(listener) {
	mValue = 0;
}

PROPERTY_TYPE PropertyS8::getType() {
	return PROPERTY_TYPE_S8;
}

void PropertyS8::getValue(const unsigned char* & value, char & size) {
	value = (const unsigned char*)&mValue;
	size = sizeof(mValue);
}

void PropertyS8::setValue(const unsigned char* value, char size) {
	if (size == 1) {
		char newValue;
		newValue = value[0];
		operator=(newValue);
	}
}
